package com.share.dao.oa.org.impl;

import java.util.LinkedHashMap;
import java.util.List;

import org.springframework.stereotype.Component;

import com.share.bean.oa.org.Employee;
import com.share.commons.base.dao.BaseDaoSupport;
import com.share.commons.base.query.PageModel;
import com.share.dao.oa.org.EmployeeDao;

@Component
public class EmployeeDaoImpl extends BaseDaoSupport<Employee> implements EmployeeDao {

	@Override
	public void saveEmpDao(Employee emp) throws RuntimeException {
		this.saveObject(emp) ;
	}

	@Override
	public PageModel<Employee> getScrollDataEmpDao(String hql, String whereHQL,
			List<Object> param, int firstResult, int maxResult,
			LinkedHashMap<String, String> orderby) throws RuntimeException {
		return this.getScrollData(hql, whereHQL, param, firstResult, maxResult, orderby) ;
	}

	@Override
	public void updateByParamEmpDao(String hql, String setHQL, String whereHQL,
			Object[] param) throws RuntimeException {
		this.executeHQL(hql, setHQL, whereHQL, param) ;
	}

	@Override
	public void updateEmpDao(Employee emp) throws RuntimeException {
		this.updateObject(emp) ;
	}

	@Override
	public Employee loadByEmpNoDao(String empNo) throws RuntimeException {
		return this.loadById(Employee.class, empNo) ;
	}

	@Override
	public Employee findByParamEmpDao(String hql, String whereHQL,
			List<Object> param) throws RuntimeException {
		return this.find(hql, whereHQL, param) ;
	}

}
